import { IAdmin, IAdminList, AdminPostData } from './../types/admin'
import request from '@/utils/request'

// 表格列表
export const getAdmins = (params:IAdminList) => request<{
    count: number
    list:IAdmin[]
}>({
  url: '/setting/admin',
  method: 'GET',
  params
})

// 添加
export const addAdmins = (data:AdminPostData) => request({
  url: '/setting/admin',
  method: 'POST',
  data
})
// 修改
export const updateAdmins = (id:number, data:AdminPostData) => request({
  url: `/setting/admin/${id}`,
  method: 'PUT',
  data
})

// 删除
export const deleteAdmins = (id:number) => request({
  url: `/setting/admin/${id}`,
  method: 'DELETE'
})

// 修改状态
export const updateAdminsStatus = (id:number, status:number) => request({
  url: `/setting/set_status/${id}/${status}`,
  method: 'PUT'
})
